//3A3B
//2A4B
// 计算误码率, 因为保证输出解压后和输入一致, 所以, 以输入进行shift,unshift操作,
// 进行逐个对比, 先取数字, 再取字母, 最后组成数组
const readline = require("readline");
const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});
let inputStr,outputStr;
rl.on("line", (line)=>{
    if(inputStr === undefined) {
        inputStr = line.trim()
    } else if (outputStr === undefined) {
        outputStr = line.trim()
        console.log(getResult(inputStr, outputStr))

        // clear
        inputStr = outputStr = undefined
    }

})

function getResult(inputStr, outputStr) {
    let inputArr = splitStr(inputStr)
    let outputArr = splitStr(outputStr)
    let count = 0
    let total = 0
    while(inputArr.length) {
        let objA = inputArr.shift()
        let objB = outputArr.shift()
        let min = Math.min(objA.number, objB.number)
        total += min


        if(objA.char !== objB.char) { // 字符不相同
            count+= min
        }

        if (objA.number > objB.number){
            inputArr.unshift({
                number: objA.number - min,
                char: objA.char
            })

        } else if (objA.number < objB.number){
            outputArr.unshift({
                number: objB.number - min,
                char: objB.char
            })
        }
    }
    return `${count}/${total}`

}

function splitStr(str) {
    let result = []
    let stack = []
    let reg = /[0-9]/

    for (const char of str) {
        if(reg.test(char)) {
            stack.push(char)
        } else { //字符
            result.push({
                number: Number(stack.join("")),
                char
            })
            stack.length = 0
        }
    }
    return result

}